/**
 *获取一行显示几个form
 * @param formColsArray
 * @param colSize
 *
 */
export const getRowNumber = (formColsArray: number[], colSize: number) => {
  let colSum = 0;
  let rowNumber = 0;
  formColsArray.some((item) => {
    colSum += item;
    if (colSum <= 24 - colSize) {
      rowNumber++;
      return false;
    } else {
      return true;
    }
  });
  return rowNumber;
};
/**
 *获取最后一行的span数量
 * @param formColsArray
 *
 */
export const getLastRowSpanNumber = (formColsArray: number[]) => {
  let colSum = 0;
  let lastRowSpan = 0;
  formColsArray.forEach((item) => {
    colSum += item;
    if (colSum > 24) {
      lastRowSpan = item;
    } else {
      lastRowSpan += item;
    }
  });
  return lastRowSpan;
};
